import VueRouter from 'vue-router'
import Vue from 'vue'
import Main from '../view/Main.vue'
import User from '../view/User'
import Home from '../view/Home'
import Mall from '../view/Mall'
import Page1 from '../view/other/page1.vue'
import Page2 from '../view/other/page2.vue'


Vue.use(VueRouter)

const router = new VueRouter({
    mode: 'history',
    routes: [
        {
            path: '/',
            name:'Main',
            component: Main,
            redirect:'/Home',
            children:[
                {
                    path:'Home',
                    name:'home',
                    component: Home
                },
                {
                    path: 'User',
                    name:'user',
                    component: User
                },
                {
                    path: 'Mall',
                    name:'mall',
                    component: Mall
                },
                {
                    path: 'Page1',
                    name:'page1',
                    component: Page1
                },
                {
                    path: 'Page2',
                    name:'page2',
                    component: Page2
                },
            ]
        },
        {
            path: '/login',
            name: 'login',
            component: () => import('../view/login/index.vue')
        }
    ]
})


export default router